# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=nats-server
pkgver=2.8.4
pkgrel=0
pkgdesc="High-Performance server for NATS.io"
url="https://github.com/nats-io/nats-server"
arch="all !x86 !armv7 !armhf !s390x !ppc64le" # limited by failing check()
options="!check" # unstable
license="Apache-2.0"
makedepends="go"
source="https://github.com/nats-io/nats-server/archive/v$pkgver/nats-server-$pkgver.tar.gz"

export GOPATH="$srcdir"
export GOMODCACHE="$srcdir/go"
export GOFLAGS="$GOFLAGS -modcacherw"

build() {
	go build
}

check() {
	go test -v -p=1 -run=TestNoRace ./server -count=1 -vet=off -timeout=30m -failfast
}

package() {
	install -Dm755 nats-server "$pkgdir"/usr/bin/nats-server
}

sha512sums="
6c93a83a7fb4411d4788e65c53c7250e5df3adf0d14cbebe858503d8cfaafd748f2497055f19746f37113be7a5c9fceb2d2239e2243b444900dd337ba2ad15fa  nats-server-2.8.4.tar.gz
"
